package day12.edu;

// Created: 12/09/2025, ChangJiang Ru
public class EvenNumberTest{
    public static void main(String[] args) {
        // Create an object of current implementation class
        EvenNumber e = new EvenNumber();
        // An instance of Thread is Created by passing the object as an argument to the Thread class constructor
        Thread t = new Thread(e);
        Thread t1 = new Thread(e);

        t1.start();
        t.start();

        new Thread(e).start();
        new Thread(e).start();

        for (int i = 0; i <= 100; i++) {
            if(i % 2 == 0)
                System.out.println(Thread.currentThread().getName() + "======>" + i);
        }
    }
}

// Creating a class that implements Runnable
class EvenNumberPrint implements Runnable
{
    // Override the run method of Runnable
    @Override
    public void run()
    {
        for (int i = 0; i <= 100; i++) {
            if(i % 2 == 0)
                System.out.println(Thread.currentThread().getName() + "----->" + i);
        }
    }
}